/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cp2004;

import java.util.ArrayList;


/**
 *

 */
public class ProductArr extends ArrayList <Product>
{
    public ProductArr(){
        itemArr items= new itemArr();
Product p = new Product();
p.setInfo("a low-level and cheap car");
p.setName("Car-C");
p.setNum(1);
p.additem(items.get(0));
p.additem(items.get(1));
add(p);
p = new Product();
p.setInfo("a medium price car");
p.setName("Car-B");
p.setNum(2);
p.additem(items.get(0));
p.additem(items.get(1));
add(p);
p = new Product();
p.setInfo("a expensive car");
p.setName("Car-A");
p.setNum(3);
add(p);

}

 public String toString(){
  String res="";
  for (int i = 0;i < size();i++){
  Product p= get(i);
  res=res+(i+1)+"."+ p + "/n";
  }
  return res;
  }

}
